package com.itheima.thread.communication.demo02;

public class CustomerThread implements Runnable {

    private Box box;
    public CustomerThread(Box box) {
        this.box = box;
    }

    @Override
    public void run() {
        while (true) {
            synchronized (box) {
                System.out.println(box.getMilkType() + "," + box.getAmount());
            }
        }
    }
}
